package com.yes.yjj;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class AppRef {
    public static void main(String[] args) throws Exception{
        Class<?> H = Class.forName("com.yes.yjj.Human");
        Object o = H.newInstance();

        Field name = H.getDeclaredField("name");
        name.setAccessible(true);
        name.set(o,"杰瑞");

        Method getName = H.getMethod("getName");
        Object result = getName.invoke(o);
        System.out.println(result);



    }
}
